import {wx} from '../../../weixin2alipay/index.js';
import {Page,Component} from '../../../weixin2alipay/index.js';
Page({
    "onShareAppMessage"(){
      return {
        "title":'获取WXML节点信息',
        "path":'packageAPI/pages/get-wxml-node-info/get-wxml-node-info'
};
    },
    "data":{
        "metrics":[
        ]
},
    "onReady"(){
      this.getNodeInfo();
    },
    "getNodeInfo"(){
      const $ = wx.createSelectorQuery();
      const target = $.select('.target');
      target.boundingClientRect();
      $.exec((res)=>{
      const rect = res[0];
      if(rect)
        {
          const metrics = [
          ];
          for(const key in rect){
              if((key !== 'id') && key !== 'dataset')
                {
                  const val = rect[key];
                  metrics.push({
                      key,
                      val
});
                }
            };
          this.setData({
              metrics
});
        };
    });
    }
});

